home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWViews / FWClustr.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.9 KB  |  105 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWClustr.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWCLUSTR_H
  11. #define FWCLUSTR_H
  12.  
  13. #ifndef FWSVIEW_H
  14. #include "FWSView.h"
  15. #endif
  16.  
  17. #ifndef FWBUTTON_H
  18. #include "FWButton.h"
  19. #endif
  20.  
  21. // ----- Foundation Layer -----
  22.  
  23. #ifndef FWRUNTYP_H
  24. #include "FWRunTyp.h"
  25. #endif
  26.  
  27. #ifndef FWSTRING_H
  28. #include "FWString.h"
  29. #endif
  30.  
  31. #ifndef FWRECEVR_H
  32. #include "FWRecevr.h"
  33. #endif
  34.  
  35. #ifndef FWTCOLL_H
  36. #include "FWTColl.h"
  37. #endif
  38.  
  39. //========================================================================================
  40. //    Foward class declarations
  41. //========================================================================================
  42.  
  43. class FW_CMouseEvent;
  44.  
  45. //========================================================================================
  46. //    Type Declarations
  47. //========================================================================================
  48.  
  49. typedef FW_TOrderedCollection<FW_CButton> FW_CButtonList;
  50.  
  51. //========================================================================================
  52. //    CLASS FW_CRadioCluster
  53. //========================================================================================
  54.  
  55. class FW_CRadioCluster : public FW_MReceiver
  56. {
  57. // ----- Initialization/destruction
  58. public:
  59.     FW_DECLARE_CLASS
  60.     FW_DECLARE_AUTO(FW_CRadioCluster)
  61.  
  62.     FW_CRadioCluster(Environment* ev);
  63.     virtual ~FW_CRadioCluster();
  64.  
  65. public:
  66.     // ----- New API
  67.     virtual void            AddRadio(Environment* ev, FW_CButton* radio);
  68.     virtual void            RemoveRadio(Environment* ev, FW_CButton* radio);
  69.  
  70.     FW_CButton*                GetButtonOn(Environment* ev) const;
  71.     ODID                    GetButtonIDOn(Environment* ev) const;
  72.  
  73.     // ----- inherited from FW_MReceiver
  74.     virtual void             HandleNotification(Environment* ev, const FW_CNotification& notification);
  75.  
  76.     // ----- Archiving -----
  77.     static void*             Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  78.     static void                Read(FW_CReadableStream& stream, FW_ClassTypeConstant type, void* object);
  79.     static void             Write(FW_CWritableStream& stream, FW_ClassTypeConstant type, const void *object);
  80.     static void                Destroy(void* object, FW_ClassTypeConstant type);
  81.  
  82.     virtual void            Flatten(Environment*ev, FW_CWritableStream& stream) const;
  83.     virtual void            InitializeFromStream(Environment*ev, FW_CReadableStream& stream);
  84.     
  85. private:
  86.     FW_CButton*                fButtonOn;
  87.     FW_CButtonList            fButtonList;
  88. };
  89.  
  90. //----------------------------------------------------------------------------------------
  91. // inlines
  92. //----------------------------------------------------------------------------------------
  93.  
  94. inline ODID FW_CRadioCluster::GetButtonIDOn(Environment* ev) const
  95. {
  96.     return fButtonOn->GetViewID(ev);
  97. }
  98.  
  99. inline FW_CButton* FW_CRadioCluster::GetButtonOn(Environment*) const
  100. {
  101.     return fButtonOn;
  102. }
  103.  
  104. #endif
  105.